<?php
	use yii\helpers\Url;

	$user_count = \app\models\MUser::find()->count();
	$oder_count = \app\models\MOrder::find()->count();
	$goods_count = \app\models\MGoods::find()->count();
	$news_count = \app\models\News::find()->count();
	$brand_count = \app\models\Brand::find()->count();

	$this->title = '主面板';
	$this->params['breadcrumbs'][] = $this->title;

?>

<style>
	html,
	body {
		height: 100%;
		font-family: "Microsoft YaHei" ! important;
	}
</style>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="/ionicons-2.0.1/css/ionicons.min.css">

<!-- Theme style -->
<link rel="stylesheet" href="/admin_lte/dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
     folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="/admin_lte/dist/css/skins/_all-skins.min.css">


<!-- Content Wrapper. Contains page content -->

	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1 style="font-family: 'Microsoft YaHei' ">
			<i class="fa fa-dashboard"></i> 主面板
			<small>控制面板</small>
		</h1>

	</section>
	<br>
	<!-- Main content -->

		<!-- Small boxes (Stat box) -->
		<div class="row">
			<div class="col-lg-3 col-xs-6">
				<!-- small box -->
				<div class="small-box bg-aqua">
					<div class="inner">
						<h3><?= $user_count ?></h3>
						<p>用户</p>
					</div>
					<div class="icon">
						<i class="ion ion-person-add"></i>
					</div>
					<a href="<?=  Url::to(['user/index']); ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
				</div>
			</div><!-- ./col -->
			<div class="col-lg-3 col-xs-6">
				<!-- small box -->
				<div class="small-box bg-green">
					<div class="inner">
						<h3><?= $oder_count ?></h3>
						<p>订单</p>
					</div>
					<div class="icon">
						<i class="ion ion-ios-cart"></i>
					</div>
					<a href="<?=  Url::to(['order/index', 'userid' => 4]); ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
				</div>
			</div><!-- ./col -->
			<div class="col-lg-3 col-xs-6">
				<!-- small box -->
				<div class="small-box bg-yellow">
					<div class="inner">
						<h3><?= $goods_count ?></h3>
						<p>商品</p>
					</div>
					<div class="icon">
						<i class="ion ion-pie-graph"></i>
					</div>
					<a href="<?=  Url::to(['goods/index', 'pub_userid' => 4, 'goods_kind' => 0]); ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
				</div>
			</div><!-- ./col -->
			<div class="col-lg-3 col-xs-6">
				<!-- small box -->
				<div class="small-box bg-red">
					<div class="inner">
						<h3><?= $news_count ?></h3>
						<p>文章</p>
					</div>
					<div class="icon">
						<i class="ion ion-ios-paper-outline"></i>
					</div>
					<a href="<?=  Url::to(['news/index', 'cat' => 0]); ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
				</div>
			</div><!-- ./col -->
		</div><!-- /.row -->


	<div class="row">
		<div class="col-lg-3 col-xs-6">
			<!-- small box -->
			<div class="small-box bg-teal">
				<div class="inner">
					<h3><?= $brand_count ?></h3>

					<p>仪表品牌</p>
				</div>
				<div class="icon">
					<i class="ion ion-ios-world"></i>
				</div>
				<a href="<?=  Url::to(['brand/index']); ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
			</div>
		</div><!-- ./col -->

		<div class="col-lg-3 col-xs-6">
			<!-- small box -->
			<div class="small-box bg-yellow">
				<div class="inner">
					<h4 style="font-family: 'Microsoft YaHei' ">公司</h4>
					<br>
					<p style="font-family: 'Microsoft YaHei' ">信息配置</p>
				</div>
				<div class="icon">
					<i class="ion ion-home"></i>
				</div>
				<a href="<?=  Url::to(['about/index']); ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
			</div>
		</div><!-- ./col -->

		<div class="col-lg-3 col-xs-6">
			<!-- small box -->
			<div class="small-box  bg-purple">
				<div class="inner">
					<h4 style="font-family: 'Microsoft YaHei' ">网站</h4>
					<br>
					<p style="font-family: 'Microsoft YaHei' ">全局配置</p>
				</div>
				<div class="icon">
					<i class="ion ion-ios-gear-outline"></i>
				</div>
				<a href="<?=  Url::to(['keywords/index']); ?>" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>
			</div>
		</div><!-- ./col -->



	</div><!-- /.row -->

